package com.newlink.building.secret.mvp.model

import com.newlink.building.common_base.base.BaseModel
import com.newlink.building.common_base.http.Base_RetrofitHelper
import com.newlink.building.common_base.model.bean.DeviceListData
import com.newlink.building.common_base.model.bean.DeviceListRequest
import com.newlink.building.common_base.model.bean.HttpResult
import com.newlink.building.common_base.model.bean.SecretKeyListData
import com.newlink.building.secret.mvp.contract.Module_Secret_SecretKeyListContract
import io.reactivex.Observable

/**
 * Created by xiaodong on 2022/10/2.
 */
class Module_Secret_SecretKeyListModel : BaseModel(), Module_Secret_SecretKeyListContract.Model {

    override fun getSecretKeyList(
        accessToken: String,
        page: Int,
        limit: Int
    ): Observable<HttpResult<SecretKeyListData>> {
        return Base_RetrofitHelper.service.getSecretKeyList(accessToken, page, limit)
    }

    override fun getDeviceList(request: DeviceListRequest): Observable<HttpResult<DeviceListData>> {
        return Base_RetrofitHelper.service.getDeviceList(
            request.accessToken,
            request.page,
            request.limit,
            request.devName,
            request.devType
        )
    }
}